﻿<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>数据清空</title>
<link href="__PUBLIC__/admin/css/xc.min.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/admin/css/xc.admin.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/lib/iconfont/iconfont.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="__PUBLIC__/admin/js/jquery.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/lib/layer/layer.js"></script>

</head>
<body>
<nav class="breadcrumb">
  <i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 系统设置 <span class="c-gray en">&gt;</span> 数据清空
  <a class="btn btn-success radius r mr-20 btn-shua" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
</nav>
<div class="pd-20">
  <div id="tab-system" class="HuiTab">
    <form action="" method="post" class="form form-horizontal" id="myform">
      <div class="tabCon">
        <div class="row cl">
          <label class="form-label col-2"></label>
          <div class="formControls col-8 c-error">
            <p>温馨提示：</p>
            <p class="c-success">
            1、清空数据库之前，<font color="#f00">请先</font>联系项目开发公司进行<font color="#f00">数据备份</font>。<br/>
            2、清空数据库将<font color="#f00">物理删除</font>选定数据库下的<font color="#f00">全部数据</font>，并且<font color="#f00">不可恢复</font>，包括：表、视图、存储过程、函数、触发器。
            </p>
          </div>
        </div>
        <div class="row cl">
          <div class="col-10 col-offset-2">
      		<button type="button" id="sub" name="sub" class="btn btn-primary radius " onClick="checkSubmit()">确定清空数据</button>
          </div>
		</div>
      </div>
    </form>
  </div>
</div>
<script type="text/javascript">
layer.config({extend: 'extend/layer.ext.js'}) 
function checkSubmit()
{
	layer.prompt({title: '输入密保安全码，并确认', formType: 1}, function(val){
		$.ajax({
			type : 'post',
			url : '/Admin/Setup/doClear',
			data : {'pwd':val},
			dataType : 'json',
			success : function(res){
				if(res.status == 1){
					layer.msg(res.msg,{icon:1});
					window.location.href = res.url;
				}else{
					layer.msg(res.msg, {icon: 2});
				}
			},
			error : function(XMLHttpRequest, textStatus, errorThrown) {
				layer.alert('网络失败，请刷新页面后重试',{icon:2});
			}
		})	
	});
}
</script>
</body>
</html>